import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../../../widgets/text_button.dart';
import 're_sign_controller.dart';

class ReSignPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return GetBuilder<ReSignController>(
        init: ReSignController(),
        builder: (controller) {
          return Scaffold(
            appBar: AppBar(title: Text('重新签名')),
            body: Container(
                margin: EdgeInsets.symmetric(vertical: 15),
                height: 90,
                child: Row(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    TextButton(
                        onPressed: () {},
                        child: Text(
                          '添加文件',
                          style: TextStyle(color: Colors.blueAccent),
                        )),
                    _textButton('重新签名', onPressed: () {
                      controller.runCommand3();
                    })
                  ],
                )),
          );
        });
  }

  _textButton(String text, {Function? onPressed}) {
    return MyTextButton(
        text: text,
        confirm: () {
          onPressed?.call();
        },
        backgroundColor: Colors.deepPurpleAccent,
        textStyle: TextStyle(color: Colors.white));
  }
}
